home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Patches.a < prev    next >
Encoding:
Text File  |  1996-05-01  |  8.0 KB  |  307 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Patches.a
  3. ;
  4. ;    Contains:    Patch Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 8
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__PATCHES__') = 'UNDEFINED' THEN
  19. __PATCHES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
  25.     include 'Kernel.a'
  26.     ENDIF
  27.     IF &TYPE('__ORDEREDITEMS__') = 'UNDEFINED' THEN
  28.     include 'OrderedItems.a'
  29.     ENDIF
  30.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  31.  
  32. kOSTrapType                        EQU        0
  33. kToolboxTrapType                EQU        1
  34. ; typedef SignedByte                     TrapType
  35.  
  36.  
  37. OSTrap                            EQU        0                    ; old name 
  38. ToolTrap                        EQU        1                    ; old name 
  39. ;
  40. ;    GetTrapAddress and SetTrapAddress are obsolete and should not
  41. ;    be used. Always use NGetTrapAddress and NSetTrapAddress instead.
  42. ;    The old routines will not be supported for PowerPC apps.
  43. ;
  44.     IF ¬ GENERATINGCFM THEN
  45. ;
  46. ; pascal UniversalProcPtr GetTrapAddress(UInt16 trapNum)
  47. ;
  48.     IF ¬ GENERATINGCFM THEN
  49.         _GetTrapAddress:    OPWORD    $A146
  50.     ELSE
  51.         IMPORT_CFM_FUNCTION GetTrapAddress
  52.     ENDIF
  53.  
  54. ;
  55. ; pascal void SetTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
  56. ;
  57.     IF ¬ GENERATINGCFM THEN
  58.         _SetTrapAddress:    OPWORD    $A047
  59.     ELSE
  60.         IMPORT_CFM_FUNCTION SetTrapAddress
  61.     ENDIF
  62.  
  63.     ENDIF
  64. ;
  65. ; pascal UniversalProcPtr GetOSTrapAddress(UInt16 trapNum)
  66. ;
  67.     IF ¬ GENERATINGCFM THEN
  68.         ; parameters:
  69.         ;    trapNum         => D0
  70.         ; returns:
  71.         ;    UniversalProcPtr <= A0
  72.         _GetOSTrapAddress:    OPWORD    $A346
  73.     ELSE
  74.         IMPORT_CFM_FUNCTION GetOSTrapAddress
  75.     ENDIF
  76.  
  77. ;
  78. ; pascal void SetOSTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
  79. ;
  80.     IF ¬ GENERATINGCFM THEN
  81.         ; parameters:
  82.         ;    trapAddr        => A0
  83.         ;    trapNum         => D0
  84.         _SetOSTrapAddress:    OPWORD    $A247
  85.     ELSE
  86.         IMPORT_CFM_FUNCTION SetOSTrapAddress
  87.     ENDIF
  88.  
  89. ;
  90. ; pascal UniversalProcPtr GetToolTrapAddress(UInt16 trapNum)
  91. ;
  92.     IF ¬ GENERATINGCFM THEN
  93.         ; parameters:
  94.         ;    trapNum         => D0
  95.         ; returns:
  96.         ;    UniversalProcPtr <= A0
  97.         _GetToolTrapAddress:    OPWORD    $A746
  98.     ELSE
  99.         IMPORT_CFM_FUNCTION GetToolTrapAddress
  100.     ENDIF
  101.  
  102. ;
  103. ; pascal void SetToolTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
  104. ;
  105.     IF ¬ GENERATINGCFM THEN
  106.         ; parameters:
  107.         ;    trapAddr        => A0
  108.         ;    trapNum         => D0
  109.         _SetToolTrapAddress:    OPWORD    $A647
  110.     ELSE
  111.         IMPORT_CFM_FUNCTION SetToolTrapAddress
  112.     ENDIF
  113.  
  114. ;
  115. ; pascal UniversalProcPtr GetToolboxTrapAddress(UInt16 trapNum)
  116. ;
  117.     IF ¬ GENERATINGCFM THEN
  118.         ; parameters:
  119.         ;    trapNum         => D0
  120.         ; returns:
  121.         ;    UniversalProcPtr <= A0
  122.         _GetToolboxTrapAddress:    OPWORD    $A746
  123.     ELSE
  124.         IMPORT_CFM_FUNCTION GetToolboxTrapAddress
  125.     ENDIF
  126.  
  127. ;
  128. ; pascal void SetToolboxTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
  129. ;
  130.     IF ¬ GENERATINGCFM THEN
  131.         ; parameters:
  132.         ;    trapAddr        => A0
  133.         ;    trapNum         => D0
  134.         _SetToolboxTrapAddress:    OPWORD    $A647
  135.     ELSE
  136.         IMPORT_CFM_FUNCTION SetToolboxTrapAddress
  137.     ENDIF
  138.  
  139. ;
  140. ;
  141. ;// Moved here from StdCLib
  142. ;pascal Boolean TrapAvailable (UInt16 trapNumber);
  143. ;
  144. ;
  145.     ENDIF
  146. ;  FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  147.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  148.  
  149.  
  150.  
  151.  
  152. ; typedef void *                        PatchableProcPtr
  153.  
  154. ; typedef OptionBits                     PatchOptions
  155.  
  156.  
  157. kPatchEnabledBit                EQU        0
  158. kPatchCompatibilityBit            EQU        1
  159. kPatchOptionalBit                EQU        2
  160.  
  161. kPatchEnabledMask                EQU        $00000001
  162. kPatchCompatibilityMask            EQU        $00000002
  163. kPatchOptionalMask                EQU        $00000004
  164. PatchName                RECORD 0
  165. f                         ds        OrderedItemName
  166. sizeof                     EQU *                    ; size:   $8 (8)
  167.                         ENDR
  168.  
  169.  
  170. ; typedef struct PatchName *            PatchNamePtr
  171.  
  172. PatchOrderRequirements    RECORD 0
  173. f                         ds        OrderRequirements
  174. sizeof                     EQU *                    ; size:   $14 (20)
  175.                         ENDR
  176.  
  177.  
  178. ; typedef struct PatchOrderRequirements * PatchOrderRequirementsPtr
  179.  
  180. PatchDescription        RECORD 0
  181. originalRoutine             ds.l    1                ; offset: $0 (0)        ;  A normal (probably imported) proc ptr.
  182. patchRoutine             ds.l    1                ; offset: $4 (4)        ;  A normal (probably imported) proc ptr.
  183. thisPatchName             ds        PatchName        ; offset: $8 (8)
  184. thisPatchOrdering         ds        PatchOrderRequirements ; offset: $10 (16)
  185. installOptions             ds.l    1                ; offset: $24 (36)
  186. installResult             ds.l    1                ; offset: $28 (40)
  187. thisPatchID                 ds.l    1                ; offset: $2C (44)        ;  Set if installed OK.
  188. thisCallThroughProc         ds.l    1                ; offset: $30 (48)        ;  Set if installed OK.
  189. rejectingPatchID         ds.l    1                ; offset: $34 (52)        ;  Set if there was an installation error.
  190. sizeof                     EQU *                    ; size:   $38 (56)
  191.                         ENDR
  192. ; typedef struct PatchDescription *        PatchDescriptionPtr
  193.  
  194. ; typedef OptionBits                     PatchHeaderOptions
  195.  
  196.  
  197. kRequiredPatchErrorsMask        EQU        $00000001            ; Any installation errors in required patches?
  198. kOptionalPatchErrorsMask        EQU        $00000002            ; Any installation errors in optional patches?
  199.  
  200. kPatchHeaderTag                    EQU        'Ptch'
  201. kPatchHeaderVersion                EQU        1
  202. PatchHeader                RECORD 0
  203. tag                         ds.l    1                ; offset: $0 (0)        ;  Must be 'Ptch'.
  204. version                     ds.l    1                ; offset: $4 (4)        ;  The data structure version.
  205. flags                     ds.l    1                ; offset: $8 (8)        ;  Set by CFM with install status.
  206. count                     ds.l    1                ; offset: $C (12)        ;  The total size of the "patches" array.
  207. patches                     ds.l    1                ; offset: $10 (16)        ;  Pointer to description array.
  208. sizeof                     EQU *                    ; size:   $14 (20)
  209.                         ENDR
  210.  
  211. kPatchInformationVersion        EQU        1
  212. PatchInformation        RECORD 0
  213. patchChain                 ds.l    1                ; offset: $0 (0)
  214. patchingRoutine             ds.l    1                ; offset: $4 (4)
  215. patchOptions             ds.l    1                ; offset: $8 (8)
  216. patchName                 ds        PatchName        ; offset: $C (12)
  217. patchOrder                 ds        PatchOrderRequirements ; offset: $14 (20)
  218. sizeof                     EQU *                    ; size:   $28 (40)
  219.                         ENDR
  220. ; typedef struct PatchInformation *        PatchInformationPtr
  221.  
  222.  
  223. kPatchChainInformationVersion    EQU        1
  224. PatchChainInformation    RECORD 0
  225. kernelProcess             ds.l    1                ; offset: $0 (0)
  226. chainRoot                 ds.l    1                ; offset: $4 (4)
  227. sizeof                     EQU *                    ; size:   $8 (8)
  228.                         ENDR
  229. ; typedef struct PatchChainInformation * PatchChainInformationPtr
  230.  
  231. ;
  232. ; *    Maps a ProcPtr to a PatchChainID.
  233. ; *        If the ProcPtr is a patch,                     return noErr and Chain
  234. ; *        If the ProcPtr is a root,                     return noErr and Chain 
  235. ; *        If the ProcPtr is not a patch or a root,     return an error
  236. ;
  237. ;
  238. ; extern OSStatus GetPatchChainFromProcPtr(KernelProcessID theKernelProcess, PatchableProcPtr theRoutine, PatchChainID *thePatchChain)
  239. ;
  240.     IF GENERATINGCFM THEN
  241.         IMPORT_CFM_FUNCTION GetPatchChainFromProcPtr
  242.     ENDIF
  243.  
  244. ;
  245. ; *    Maps a ProcPtr to a PatchID.
  246. ; *        If the ProcPtr is a patch,                     return noErr and the PatchID
  247. ; *        If the ProcPtr is a root,                     return notAPatchErr
  248. ; *        If the ProcPtr is not a patch or a root,     return notAPatchErr
  249. ;
  250. ;
  251. ; extern OSStatus GetPatchFromProcPtr(KernelProcessID theKernelProcess, PatchableProcPtr theRoutine, PatchID *thePatch)
  252. ;
  253.     IF GENERATINGCFM THEN
  254.         IMPORT_CFM_FUNCTION GetPatchFromProcPtr
  255.     ENDIF
  256.  
  257. ;
  258. ; extern OSStatus GetPatchChainInformation(PatchChainID thePatchChain, PBVersion version, PatchChainInformation *patchChainInfo)
  259. ;
  260.     IF GENERATINGCFM THEN
  261.         IMPORT_CFM_FUNCTION GetPatchChainInformation
  262.     ENDIF
  263.  
  264. ;
  265. ; extern OSStatus GetPatchInformation(PatchID thePatchID, PBVersion version, PatchInformation *patchInfo)
  266. ;
  267.     IF GENERATINGCFM THEN
  268.         IMPORT_CFM_FUNCTION GetPatchInformation
  269.     ENDIF
  270.  
  271. ;
  272. ; *    Iteration functions:
  273. ; *        Get all the chains in a KernelProcess, and
  274. ; *        Get all the patches in a chain
  275. ;
  276. ;
  277. ; extern OSStatus GetPatchChainsInKernelProcess(KernelProcessID theKernelProcess, ItemCount requestedPatchChains, ItemCount *totalPatchChains, PatchChainID *thePatchChains)
  278. ;
  279.     IF GENERATINGCFM THEN
  280.         IMPORT_CFM_FUNCTION GetPatchChainsInKernelProcess
  281.     ENDIF
  282.  
  283. ;
  284. ; extern OSStatus GetPatchesInPatchChain(PatchChainID thePatchChain, ItemCount requestedPatches, ItemCount *totalPatches, PatchID *thePatches)
  285. ;
  286.     IF GENERATINGCFM THEN
  287.         IMPORT_CFM_FUNCTION GetPatchesInPatchChain
  288.     ENDIF
  289.  
  290. ;
  291. ; extern OSStatus EnablePatch(PatchID thePatch)
  292. ;
  293.     IF GENERATINGCFM THEN
  294.         IMPORT_CFM_FUNCTION EnablePatch
  295.     ENDIF
  296.  
  297. ;
  298. ; extern OSStatus DisablePatch(PatchID thePatch)
  299. ;
  300.     IF GENERATINGCFM THEN
  301.         IMPORT_CFM_FUNCTION DisablePatch
  302.     ENDIF
  303.  
  304.     ENDIF
  305.     ENDIF ; __PATCHES__ 
  306.  
  307.